10 '*****************
20 '**     FLY     **
30 '*****************
40 '
50 CLEAR
60 GOSUB 1730
70 SCREEN 1
80 KEY OFF
90 CLS
100 COLOR 0, 0
110 OPTION BASE 1
120 DEFINT X-Y
130 DIM FLY0(21), FLY1(21), FLY2(21)
140 DIM SWAT(714)
150 DIM X(3), Y(3)
160 DELAY = 3000
170 '
180 ' BUILD THE FLY IMAGES
190 BODY$ = "c1u5be1d6r1u6bf1d5"
200 URWING$ = "c3bu3br1e3r1g3r1e3"
210 ULWING$ = "bg3bl7h3l1f3l1h3"
220 DRWING$ = "c3br6h3l1f3l1h3"
230 DLWING$ = "bl5g3l1e3l1g3"
240 DRAW BODY$ + URWING$ + ULWING$
250 DRAW "bd20br6"
260 DRAW BODY$ + DRWING$ + DLWING$
270 GET (131, 91)-(152, 103), FLY0
280 GET (151, 91)-(172, 103), FLY1
290 GET (151, 105)-(172, 117), FLY2
300 '
310 ' BUILD THE SWATTER IMAGE
320 CLS
330 LINE (0, 50)-(75, 135), 3, BF
340 FOR X = 5 TO 65 STEP 10
350 FOR Y = 55 TO 125 STEP 10
360 LINE (X, Y)-(X + 5, Y + 5), 0, BF
370 NEXT Y, X
380 FOR Y = 106 TO 135
390 IF Y < 111 THEN CLR = 3 ELSE CLR = 0
410 NEXT Y
420 LINE (30, 136)-(45, 199), 1, BF
430 GET (0, 50)-(75, 199), SWAT
440 '
450 ' DRAW THE SCREEN BORDER
460 CLS
470 LINE (0, 0)-(319, 199), 2, BF
480 LINE (9, 9)-(310, 190), 3, BF
490 '
500 ' NEXT FLY APPEARS
510 LINE (15, 15)-(304, 184), 0, BF
520 FOR I = 1 TO 7 + 5 * RND
530 FLY = INT(3 * RND + 1)
540 BUZZ = 0
550 SOUND 47, 0
560 SOUND 65 + 7 * RND, 999
570 WHILE BUZZ < DELAY
580 PUT (74 * FLY, 67), FLY1, PSET
590 PUT (74 * FLY, 67), FLY2, PSET
600 BUZZ = BUZZ + 99
610 WEND
620 SOUND 47, 0
630 PUT (74 * FLY, 67), FLY0, PSET
640 NEXT I
650 '
660 ' SWATTERS SCHWAAPF ONTO SCREEN
670 FOR SWIPE = 1 TO 3
680 SOUND 999, 1
690 PUT (87 * SWIPE - 51, 35), SWAT
700 NEXT SWIPE
710 '
720 ' HOW WELL DID YOU FOLLOW THE FLY?
730 K$ = INKEY$
740 IF K$ <> "" THEN 730
750 LOCATE 3, 7
760 PRINT "CHECK WHICH SWATTER (1,2,3) ?"
770 K$ = INKEY$
775 IF K$ = CHR$(27) THEN CLS : END
780 IF K$ = "" THEN 770
790 IF K$ <> "1" AND K$ <> "2" AND K$ <> "3" THEN 770
800 GUESS = VAL(K$)
810 LINE (87 * GUESS - 51, 35)-(87 * GUESS + 24, 184), 0, BF
820 IF GUESS <> FLY THEN 1260
830 '
840 ' ANOTHER ONE BYTES THE DUST
850 DELAY = .7370001 * DELAY
860 GOSUB 1490
870 LOCATE 3, 7
880 PRINT "GOT IT !!!"; TAB(37);
890 SPOT = 74 * GUESS + 9
900 FOR I = 0 TO 40
910 FREQ = 99 * SIN(2.1 - I / 17) ^ 3 + 678
920 SOUND 99, 0
930 SOUND FREQ, 2
950 CLR = INT(3 * RND + 1)
960 DX = INT(9 * RND - 4)
970 DY = INT(9 * RND - 4)
990 NEXT I
1000 LINE (15, 15)-(304, 184), 0, BF
1010 IF RANK = 99 THEN 1620
1020 IF RANK <> 11 THEN 1100
1030 '
1040 ' YOU MADE IT PAST THE FIRST LEVEL OF PROFICIENCY
1050 RANK = 1
1060 LINE (15, 15)-(304, 184), 0, BF
1070 LOCATE 12, 4
1080 PRINT "YOU JUST MADE 'SENIOR DE-BUGGER'!!!"
1090 PLAY "MF O3 T200 L5 MS cde.cffcd.cde.cffcd..."
1100 IF RANK <> 12 THEN 1180
1110 '
1120 ' YOU MADE IT PAST THE SECOND LEVEL OF PROFICIENCY
1130 RANK = 2
1140 LINE (15, 15)-(304, 184), 0, BF
1150 LOCATE 12, 4
1160 PRINT "WOW! WHAT A PROFESSIONAL! BUZZ ON!";
1170 PLAY "MF O3 T200 L5 MS ccg.ccg.efedccffcd..."
1180 LINE (15, 15)-(304, 184), 0, BF
1190 LOCATE 12, 4
1200 PRINT "OH OH! HERE COMES A FASTER FLY ...";
1210 FOR I = 1 TO 999
1220 NEXT I
1230 GOTO 510
1240 '
1250 ' MISSED IT
1260 DELAY = 1.47 * DELAY
1270 IF DELAY > 3000 THEN DELAY = 3000
1280 GOSUB 1490
1290 LINE (87 * FLY - 51, 35)-(87 * FLY + 24, 184), 0, BF
1300 LOCATE 3, 7
1310 PRINT "WHOOPS, IT GOT AWAY."; TAB(37);
1320 SOUND 57, 47
1330 FOR I = 1 TO 100
1340 PUT (74 * FLY, 67), FLY1, PSET
1350 PUT (74 * FLY, 67), FLY2, PSET
1360 NEXT I
1370 LINE (15, 15)-(304, 184), 0, BF
1380 LOCATE 12, 7
1390 IF DELAY = 3000 THEN MISS$ = "HERE COMES ANOTHER ONE ..."
1400 IF DELAY < 3000 THEN MISS$ = "HERE COMES A SLOWER FLY ..."
1410 PRINT MISS$;
1420 IF SPEED < 9000 THEN RANK = 1
1430 IF SPEED < 8000 THEN RANK = 0
1440 FOR I = 1 TO 999
1450 NEXT I
1460 GOTO 510
1470 '
1480 ' COMPUTE SCORE AND RANK
1490 SPEED = (3000 - DELAY) * 10 / 3
1500 IF SPEED < 0 THEN SPEED = 0
1510 LOCATE 25, 5
1520 PRINT USING "SPEED = ####"; SPEED;
1530 IF SPEED > RECORD THEN RECORD = SPEED
1540 LOCATE 25, 22
1550 PRINT USING "RECORD = ####"; RECORD;
1560 IF SPEED > 8000 AND RANK < 1 THEN RANK = 11
1570 IF SPEED > 9000 AND RANK < 2 THEN RANK = 12
1580 IF SPEED > 9999 THEN RANK = 99
1590 RETURN
1600 '
1610 ' BEST SCORE POSSIBLE!
1620 LOCATE 10, 5
1630 PRINT "YOU DID IT!!! NO BUGS LEFT!!!"
1640 LOCATE 12, 5
1650 PRINT "WELCOME TO THE S.W.A.T TEAM !"
1660 PLAY "T169 L9 MS abcdefgacegecacgfedfdfdgdccedabbcaegfc"
1670 BGD = INT(RND * 6)
1680 PLT = INT(RND * 2)
1690 COLOR BGD, PLT
1700 GOTO 1660
1710 '
1720 ' SUBROUTINE RESET RANDOM NUMBER SEQUENCE
1730 RANDOMIZE VAL(MID$(TIME$, 4, 2) + RIGHT$(TIME$, 2))
1740 RETURN

